import request from "../../utils/request";

export interface MenuItem {
    id: number;
    title: string;
    url: string;
    code: string;
    sort: number;
    attributeList: { icon: string };
    type: string;
    createTime: number;
    menus?: MenuItem[];
}

export interface Menu {
    sysName: string;
    env: string;
    userName: string;
    authority: string;
    roleList: { roleId: number; roleName: string }[];
    menuList: MenuItem[];
}

export interface User {
    id?: number;
    mis?: string;
    username?: number;
    avatarUrl?: string;
    email?: number;
}

export default {
    // 获取菜单列表
    getMenuList() {
        return request({
            url: '/common/getMenus',
            method: 'GET'
        })
    },
    // 获取用户信息
    getUserInfo() {
        return request({
            url: '/user/getUserInfo',
            method: 'POST',
            data: {}
        })
    }
}